package com.example.domain;

import com.baomidou.mybatisplus.annotation.*;

import java.util.Date;

import com.example.util.EnhancedGetUrlBuilder;
import com.example.util.constant.NodeUrlConstant;
import lombok.Data;

/**
 * 
 * @TableName bus_note
 */
@TableName(value ="bus_note")
@Data
public class BusNote {
    /**
     * 主键id
     */
    @TableId(type = IdType.ASSIGN_UUID)
    private String id;

    /**
     * 标题名称
     */
    private String titleName;

    /**
     * 标题类型id
     */
    private String titleTypeId;

    /**
     * 标题标签
     */
    private String titleTag;

    /**
     * 用户id
     */
    private String userId;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT) // 自动填充创建时间
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE) // 自动填充更新时间
    private Date updateTime;

    /**
     * 删除状态
     */
    @TableLogic
    private Integer isDeleted;

    /**
     * 数据节点id
     */
    private String dsNo;

    @TableField(exist = false)
    private String url;

    public String getUrl() {
        EnhancedGetUrlBuilder enhancedGetUrlBuilder=new EnhancedGetUrlBuilder(NodeUrlConstant.NOTE_GETONE);
        enhancedGetUrlBuilder.arrayParam("nodeId",this.dsNo);
        enhancedGetUrlBuilder.arrayParam("noteId",this.id);
        return enhancedGetUrlBuilder.toString();
    }

}